1. Field of the Invention
The present invention relates to a method for enhancing the contrast of an image and an apparatus therefor. More particularly, the present invention relates to a method for enhancing the contrast of an image and an apparatus therefor by using a mask processor to reduce a memory space.
2. Description of Related Art
Due to rapid advances of a variety of multimedia applications, multimedia technologies have been widely adopted in mobile devices. For instance, cell phones, personal digital assistants (PDAs), digital cameras, global positioning systems (GPSs), or the like mobile devices are equipped with an audio-visual playback function. As the multimedia technologies are integrated into the mobile devices, various image processing technologies must be taken into consideration, such as image compression, image sharpness, contrast enhancement of the images, and so on. Thereby, users of the mobile devices are able to watch the images of high definition.
Here, the contrast enhancement of the image is conducive to an improvement of image qualities, for not only each and every detail in the image is displayed distinctly, but also a depth-of-focus of the image is significantly improved and the stereoscopic image can be achieved. In light of the foregoing, the attention from the public has been drawn to the way to integrate an apparatus for enhancing the contrast into a miniaturized mobile device. Several references pertinent to the related art with respect to the contrast enhancement of the image are briefly described hereinafter.
The first reference is a thesis entitled “Contrast Enhancement Using Brightness Preserving Bi-histogram Equalization” published in Transactions on Consumer Electronics by Institute of Electrical and Electronic Engineers (IEEE) in the year of 1997.
In the prior art reference, the histogram equalization is used for contrast enhancement of an image. Referring to the histograms of FIGS. 1 and 2, the histogram equalization refers to an analysis of gray-scale distribution of the entire image, so as to establish the histogram as shown in FIG. 1. Afterwards, the histogram constituted by the image is analyzed and calculated, so as to approximate the number of the pixels of bright parts of the image to the number of the pixels of dark parts of the image. Further, the contrast among the pixels is enhanced. In other words, as shown in FIG. 2, the luminance distribution of the image indicated in the histogram is more equalized. Note that the conventional histogram equalization easily leads to distortion of image luminance, and thus the pixels of the image are divided into two regions having pixel values larger than or less than an average gray-scale value before the histogram equalization is conducted according to the prior art reference, so as to perform another algorithm with respect to the histogram equalization on the bright region and on the dark region, respectively. Thereby, distortion of image luminance may be further reduced.
Nevertheless, although the issue concerning distortion of image luminance is resolved by the prior art reference, massive memory spaces are required by the mobile devices according to this reference, such that the histogram constituting the entire image can be obtained. Moreover, two calculations performed on histogram equalization result in complexity of manufacturing the mobile devices.
The second reference is a thesis entitled “Fuzzy Contrast Correction for Image Contrast Enhancement” published by Society for Information Display (SID) in the year of 2006, which will be explained below as shown in FIGS. 3 and 4. FIG. 3 is a histogram illustrating a result of analyzing gray-scale distribution of an image, while FIG. 4 is a schematic diagram illustrating a function of enhancing the contrast of the image. Referring to FIGS. 3 and 4 together, in the prior art reference, the histogram is divided into a bright side and a dark side according to an average gray-scale value. After that, two peaks having a maximum pixel number, i.e., a, b, c, and d as indicated in FIG. 3, are retrieved from the bright side and the dark side, respectively. Thereby, with use of the peaks a˜d, corresponding functions required by both the bright side and the dark side are chosen from the functions shown in FIG. 4, to enhance image contrast.
However, in this prior art reference, the massive memory space is still needed by the mobile devices for obtaining the histogram constituting the entire image. Besides, the required equipment for practicing the prior art reference is still of great complexity and is not apt to be applied to the mobile devices.
Based on the above, the prior art references are relatively complicated in terms of actual applications. Further, considerable memory capacity is required thereby, and thus said technologies disclosed by the prior art references are not adapted to the mobile devices due to the requirements for low costs and compactness.